//
// Created by lingzhitech on 25-9-12.
//

#include <iostream>
#include <sstream>
#include <vector>

// members are public by default; see § 7.2 (p. 268)
struct PersonInfo {
    std::string name;
    std::vector<std::string> phones;
};

int main() {
    std::string line, word; // will hold a line and word from input, respectively
    std::vector<PersonInfo> people; // will hold all the records from the input
    // read the input a line at a time until cin hits end-of-file (or another error)
    while (getline(std::cin, line)) {
        PersonInfo info; // create an object to hold this record's dataistringstream record(line); // bind record to the line we just read
        std::istringstream record(line); // bind record to the line we just read
        record >> info.name; // read the name
        while (record >> word) // read the phone numbers
            info.phones.push_back(word); // and store them
        people.push_back(info); // append this record to people
    }


    for (const auto &p : people) {
        std::cout << "name: " << p.name << " | phone nums:";
        for (const auto &num : p.phones) {
            std::cout << " " << num;
        }
        std::cout << std::endl;
    }
}
